package com.jymj.enumEntity;

/**
 * Created by ljj on 2017/7/20. 行业类型
 */
public enum IndustryEnum {
    one("农林牧渔业", 1),
    two("公共管理", 2),
    tree("制造业", 3),
    four("能源产业", 4),
    five("批发零售业", 5),
    six("交通、仓储业", 6),
    seven("住宿餐饮业", 7),
    eight("信息技术服务业", 8),
    nine("房地产业", 9),
    ten("商务服务业", 10),
    eleven("居民服务业", 11),
    twelve("教育", 12),
    thirteen("文化娱乐", 13),
    fourteen("其他", 0);
    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private IndustryEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (IndustryEnum s : IndustryEnum.values()) {
            if (s.getIndex() == index) {
                return s.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
